import request from '@/utils/request'
// faultId (string, optional): 主键id ,
// faultLevel (integer, optional): 层级 ,
// faultName (string, optional): 故障名称 ,
// faultType (integer, optional): 1-质量问题 2-安全问题 ,
// parentId (string, optional): 父节点id ,
// parentIds (string, optional): 所有父节点id ,
// sort (integer, optional): 排序
//获取所有故障类型
export function getAllPart() {
  return request({
    url: '/faultCategory/getAll',
    method: 'get',
  })
}
// /faultCategory/getByParentId
export function getByParentId(id) {
  return request({
    url: '/faultCategory/getByParentId',
    method: 'get',
    params: id,
  })
}
export function add(data) {
  return request({
    url: '/faultCategory/add',
    method: 'post',
    data,
  })
}
//
export function deleteById(data) {
  return request({
    url: '/faultCategory/deleteById',
    method: 'post',
    data,
  })
}
//更新节点
export function updatePart(data) {
  return request({
    url: '/faultCategory/mod',
    method: 'post',
    data,
  })
}
